body {
    padding: 0px;
    margin: 0px;
}
.game {
    position: relative;
    font-family: "Arial", sans;
    margin: 0px;
    pading: 0px;
}
.game > .statusBar {
    position: absolute;
}
.game > .promotionContainer {
    position: absolute;
    left: 0px;
    top: 0px;
    right: 0px;
    bottom: 0px;
    background-image: url("modal.png");
    background-repeat: repeat;
    z-index: 10;
    margin: 0px;
    padding: 0px;
    display: none;
}
.game > .promotionContainer > .dialog {
    position: absolute;
    border: rgb(128,128,128) solid 1px;
    background-color: white;
}
.game > .promotionContainer > .dialog > .item {
    cursor: pointer;
    vertical-align: middle;
}
.game > .promotionContainer > .dialog > .item > * {
    vertical-align: middle;
}
.game > .promotionContainer > .dialog > .item > .piece {
    display: inline-block;
    background-repeat: no-repeat;
}
.game > .promotionContainer > .dialog > .item:hover {
    background-color: rgb(240,240,240);
}
.board {
    position: absolute;
}
.board > .left-coord {
    position: absolute;
    text-align: right;
    vertical-align: middle;
}
.board > .right-coord {
    position: absolute;
    text-align: left;
    vertical-align: middle;
}
.board > .top-coord {
    position: absolute;
    vertical-align: bottom;
    text-align: center;
}
.board > .bottom-coord {
    position: absolute;
    vertical-align: top;
    text-align: center;
}
.board > .black.cell {
    background: rgb(120,120,120);
}
.board > .white.cell {
    background: rgb(200,200,200);
}
.board > .cell {
    position: absolute;
}
.cell > .piece {
    position: absolute;
    left: 0px;
    top: 0px;
    right: 0px;
    bottom: 0px;
    background-repeat: no-repeat;
}
.board > .cell > .selected.piece {
    background-color: rgb(96,96,255);
}
.movesWrapper {
    position: absolute;
    overflow: auto;
    background-color: rgb(240,240,240);
}
.moves {
    border-spacing: 0px;
    padding: 0px;
}
.moves .number {
    font-weight: bold;
}
.moves .white {
    color: rgb(96,96,96);
}
.moves .black {
    color: rgb(96,96,96);
}

@media all and (min-width: 640px) and (min-height: 480px) {
    .game {
        width: 550px;
        height: 450px;
        font-size: 10pt;
    }
    .game > .statusBar {
        top: 420px;
        height: 30px;
        left: 4px;
        right: 4px;
    }
    .game > .promotionContainer > .dialog {
        left: 100px;
        right: 100px;
        top: 150px;
        height: 192px;
        border-radius: 5px;
        padding: 5px;
    }
    .game > .promotionContainer > .dialog > .item {
        height: 48px;
        line-height: 48px;
        padding-left: 6px;
    }
    .game > .promotionContainer > .dialog > .item > .piece {
        width: 44px;
        height: 44px;
        background-image: url("pieces42.png");
    }
    .board {
        left: 20px;
        top: 30px;
        width: 352px;
        height: 352px;
    }
    .board > .left-coord {
        left: -20px;
        width: 16px;
        line-height: 44px;
    }
    .board > .right-coord {
        right: -20px;
        width: 16px;
        line-height: 44px;
    }
    .board > .top-coord {
        top: -30px;
        height: 26px;
        line-height: 26px;
    }
    .board > .bottom-coord {
        bottom: -30px;
        height: 26px;
        line-height: 26px;
    }
    .board > .col1 {
        left: 0px;
        width: 44px;
    }
    .board > .col2 {
        left: 44px;
        width: 44px;
    }
    .board > .col3 {
        left: 88px;
        width: 44px;
    }
    .board > .col4 {
        left: 132px;
        width: 44px;
    }
    .board > .col5 {
        left: 176px;
        width: 44px;
    }
    .board > .col6 {
        left: 220px;
        width: 44px;
    }
    .board > .col7 {
        left: 264px;
        width: 44px;
    }
    .board > .col8 {
        left: 308px;
        width: 44px;
    }
    .board > .row8 {
        top: 0px;
        height: 44px;
    }
    .board > .row7 {
        top: 44px;
        height: 44px;
    }
    .board > .row6 {
        top: 88px;
        height: 44px;
    }
    .board > .row5 {
        top: 132px;
        height: 44px;
    }
    .board > .row4 {
        top: 176px;
        height: 44px;
    }
    .board > .row3 {
        top: 220px;
        height: 44px;
    }
    .board > .row2 {
        top: 264px;
        height: 44px;
    }
    .board > .row1 {
        top: 308px;
        height: 44px;
    }
    .cell > .piece {
        background-image: url("pieces42.png");
    }
    .black.pawn {
        background-position: 1px -41px;
    }
    .black.knight {
        background-position: -41px -41px;
    }
    .black.bishop {
        background-position: -83px -41px;
    }
    .black.rook {
        background-position: -125px -41px;
    }
    .black.queen {
        background-position: -167px -41px;
    }
    .black.king {
        background-position: -209px -41px;
    }
    .white.pawn {
        background-position: 1px 1px;
    }
    .white.knight {
        background-position: -41px 1px;
    }
    .white.bishop {
        background-position: -83px 1px;
    }
    .white.rook {
        background-position: -125px 1px;
    }
    .white.queen {
        background-position: -167px 1px;
    }
    .white.king {
        background-position: -209px 1px;
    }
    .movesWrapper {
        left: 400px;
        width: 140px;
        top: 30px;
        height: 344px;
        border-radius: 5px;
        padding: 4px;
    }
    .moves {
        padding-left: 3px;
        padding-right: 3px;
    }
    .moves * {
        font-size: 9pt;
    }
}

@media all and (max-width: 640px) and (max-height: 480px) and (min-width: 400px) and
        (min-height: 250px) and (orientation: landscape), 
       all and (max-width: 500px) and (min-width: 320px) and (orientation: portrait) {
    .game {
        width: 400px;
        height: 300px;
        font-size: 8pt;
    }
    .game > .statusBar {
        top: 286px;
        height: 14px;
        left: 3px;
        right: 3px;
    }
    .game > .promotionContainer > .dialog {
        left: 60px;
        right: 60px;
        top: 94px;
        height: 132px;
        border-radius: 4px;
        padding: 4px;
    }
    .game > .promotionContainer > .dialog > .item {
        height: 32px;
        line-height: 32px;
        padding-left: 1px;
    }
    .game > .promotionContainer > .dialog > .item > .piece {
        width: 32px;
        height: 32px;
        background-image: url("pieces32.png");
    }
    .board {
        left: 10px;
        top: 14px;
        width: 256px;
        height: 256px;
    }
    .board > .left-coord {
        left: -10px;
        width: 8px;
        line-height: 32px;
    }
    .board > .right-coord {
        right: -10px;
        width: 8px;
        line-height: 32px;
    }
    .board > .top-coord {
        top: -14px;
        height: 12px;
        line-height: 10px;
    }
    .board > .bottom-coord {
        bottom: -14px;
        height: 12px;
        line-height: 12px;
    }
    .board > .col1 {
        left: 0px;
        width: 32px;
    }
    .board > .col2 {
        left: 32px;
        width: 32px;
    }
    .board > .col3 {
        left: 64px;
        width: 32px;
    }
    .board > .col4 {
        left: 96px;
        width: 32px;
    }
    .board > .col5 {
        left: 128px;
        width: 32px;
    }
    .board > .col6 {
        left: 160px;
        width: 32px;
    }
    .board > .col7 {
        left: 192px;
        width: 32px;
    }
    .board > .col8 {
        left: 224px;
        width: 32px;
    }
    .board > .row8 {
        top: 0px;
        height: 32px;
    }
    .board > .row7 {
        top: 32px;
        height: 32px;
    }
    .board > .row6 {
        top: 64px;
        height: 32px;
    }
    .board > .row5 {
        top: 96px;
        height: 32px;
    }
    .board > .row4 {
        top: 128px;
        height: 32px;
    }
    .board > .row3 {
        top: 160px;
        height: 32px;
    }
    .board > .row2 {
        top: 192px;
        height: 32px;
    }
    .board > .row1 {
        top: 224px;
        height: 32px;
    }
    .cell > .piece {
        background-image: url("pieces32.png");
    }
    .black.pawn {
        background-position: 0px -32px;
    }
    .black.knight {
        background-position: -32px -32px;
    }
    .black.bishop {
        background-position: -64px -32px;
    }
    .black.rook {
        background-position: -96px -32px;
    }
    .black.queen {
        background-position: -128px -32px;
    }
    .black.king {
        background-position: -160px -32px;
    }
    .white.pawn {
        background-position: 0px 0px;
    }
    .white.knight {
        background-position: -32px 0px;
    }
    .white.bishop {
        background-position: -64px 0px;
    }
    .white.rook {
        background-position: -96px 0px;
    }
    .white.queen {
        background-position: -128px 0px;
    }
    .white.king {
        background-position: -160px 0px;
    }
    .movesWrapper {
        left: 286px;
        width: 110px;
        top: 16px;
        height: 252px;
        border-radius: 3px;
        padding: 3px;
    }
    .moves {
        padding-left: 2px;
        padding-right: 2px;
    }
    .moves * {
        font-size: 7pt;
    }
}
